$(function () {
    $("button#sou").click(function (){
       //如果有搜索按钮，定义一个onclick即可
                                // 声明变量
            var input, filter, table, tr, td,td1,td2,td3,td4,td5,td6,td7,td8,td9,td10,td11, i;
            input = document.getElementById("key");
            filter = input.value.toUpperCase(); //toUpperCase()是不区分大小写
            console.log(filter);
            table = document.getElementById("myTable");
            tr = table.getElementsByTagName("tr");

            // 循环表格每一行，查找匹配项
            for (i = 0; i < tr.length; i++) {
                td = tr[i].getElementsByTagName("td")[0]; //这个0时要搜索第1列的内容，以此类推
                td1 = tr[i].getElementsByTagName("td")[1];
                td2 = tr[i].getElementsByTagName("td")[2];
                td3 = tr[i].getElementsByTagName("td")[3];
                td4 = tr[i].getElementsByTagName("td")[4];
                td5 = tr[i].getElementsByTagName("td")[5];
                td6 = tr[i].getElementsByTagName("td")[6];
                td7 = tr[i].getElementsByTagName("td")[7];
                td8 = tr[i].getElementsByTagName("td")[8];
                td9 = tr[i].getElementsByTagName("td")[9];
                td10 = tr[i].getElementsByTagName("td")[10];
                td11= tr[i].getElementsByTagName("td")[11];


                if (td || td1 || td2 || td3 || td4 || td5 || td6 ||td7 ||td8 ||td9 ||td10 ||td11) {
                    if (td.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td1.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td2.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td3.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td4.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td5.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td6.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td7.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td8.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td9.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td10.innerHTML.toUpperCase().indexOf(filter) > -1
                        || td11.innerHTML.toUpperCase().indexOf(filter) > -1) {  //如果要区分大小写就去掉这个toUpperCase()
                        tr[i].style.display = "";
                    } else {
                        tr[i].style.display = "none";
                    }
                }
            }


    });
});